package com.sprouting.ops.service;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sprouting.ops.dao.OpsSiteFaultDao;
import com.sprouting.ops.model.OpsSiteFault;
import com.sprouting.ops.model.qo.OpsSiteFaultQo;
import com.sprouting.ops.model.vo.OpsSiteFaultVo;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;

import javax.annotation.Resource;
import java.util.List;

/**
 * (现场故障上报)表服务实现类
 *
 * @author longx
 * @since 2023-11-20 17:56:36
 */
@Service
@Slf4j
public class OpsSiteFaultService extends ServiceImpl<OpsSiteFaultDao, OpsSiteFault> {

    @Resource
    private OpsSiteFaultDao opsSiteFaultDao;

    /**
     * 分页查询
     * @param page 分页参数
     * @param query 查询参数
     * @return
     */
    public Page<OpsSiteFaultVo> getOpsSiteFaultPageList(Page page, OpsSiteFaultQo query) {
        return opsSiteFaultDao.getOpsSiteFaultPageList(page, query);
    }

    /**
     * 根据应用获取故障总数
     * @param appDeployIdList 部署应用ID
     * @return
     */
    public long getCountByAppDeployId(List<String> appDeployIdList) {
        return opsSiteFaultDao.getCountByAppDeployId(appDeployIdList);
    }
}

